package com.apps.member.model.po;

import com.apps.sannotation.constraints.*;
import com.apps.sannotation.identity.GmtCreate;
import com.apps.sannotation.identity.GmtModify;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import java.time.LocalDateTime;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 
 * </p>
 *
 * @author 大鹏
 * @since 2020-10-02
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("kupa_member")
public class KupaMember implements Serializable {

    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    /**
     * 手机号
     */
    @Mobile
    private String mobile;

    /**
     * 邮箱
     */
    @Email
    @StrDef("")
    private String email;
    @StrDef("")
    private String wx_openid;
    @StrDef("")
    private String wx_unionid;
    @StrDef("")
    private String qq_openid;

    /**
     * 昵称
     */
    @StrDef("未设置")
    @StrLen(max = 15,min = 1,errMsg = "昵称最长15个字")
    private String nick_name;

    /**
     * 头像
     */
    @StrDef("")
    private String head_photo;

    /**
     * 用户级别  0=普通用户,1=vip
     */
    @NumDef(0)
    private Integer level;

    /**
     * 等级名称
     */
    @StrDef("普通用户")
    private String level_name;

    /**
     * 会员到期时间
     */
    private LocalDateTime gmt_vip_expire;

    /**
     * vip剩余天数
     */
    private Integer vip_days_remaining;

    @NumDef(0)
    @NumRange(min = 0,max = 1,errMsg = "性别只能是0或者1")
    private Integer sex;
    /**
     * 总计登录次数
     */
    @NumDef(0)
    private Integer total_login_num;

    /**
     * 最后一次登录时间,每次登录的时候要更新这个值
     */
    @NoNull(errMsg = "最后登录时间不能为空")
    private LocalDateTime gmt_last_login;

    @GmtCreate
    private LocalDateTime gmt_create;
    @GmtModify
    private LocalDateTime gmt_modify;
    @StrDef("")
    private String remark;


    public static final String ID = "id";

    public static final String MOBILE = "mobile";

    public static final String EMAIL = "email";

    public static final String WX_OPENID = "wx_openid";

    public static final String WX_UNIONID = "wx_unionid";

    public static final String QQ_OPENID = "qq_openid";

    public static final String NICK_NAME = "nick_name";

    public static final String HEAD_PHOTO = "head_photo";

    public static final String LEVEL = "level";

    public static final String TOTAL_LOGIN_NUM = "total_login_num";

    public static final String GMT_LAST_LOGIN = "gmt_last_login";

    public static final String GMT_CREATE = "gmt_create";

    public static final String GMT_MODIFY = "gmt_modify";

    public static final String REMARK = "remark";

}
